package com.ehotting.edsta.diagnosisPredict.feign.factory;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeOperator;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeProcessingTreeDto;
import com.ehotting.edsta.diagnosisPredict.feign.FeOperatorFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 特征算子的降级处理
 * 
 * @author edsta
 */
@Slf4j
@Component
public class FeOperatorFallbackFactory implements FallbackFactory<FeOperatorFeignService> {

    @Override
    public FeOperatorFeignService create(Throwable throwable)
    {
        log.error("特征算子调用失败:{}", throwable.getMessage());
        return new FeOperatorFeignService() {
            @Override
            public Response<List<FeOperator>> list(Long canvasld, String coordinate, String createTime, Long id, Long iteminfold, String itemname, Long menuId, String operatorType, String operatorname, Long pid) {
                return null;
            }

            @Override
            public Response<List<FeProcessingTreeDto>> getTree(Long canvasld) {
                return null;
            }

            @Override
            public Response<FeOperator> save(FeOperator feOperator) {
                return null;
            }

            @Override
            public Response<Map<String, String>> exec(FeOperator feOperator) {
                return null;
            }

            @Override
            public Response<Map<String, String>> getCacheById(String id) {
                return null;
            }
        };
    }
}
